
#include "Mediator.h"
#include "ColleagueA.h"
#include "ColleagueB.h"

using namespace npMediator;
using namespace std;


void doMediator()
{
    shared_ptr<Mediator> mediator = make_shared<Mediator>();

    shared_ptr<Colleague> a = make_shared<ColleagueA>('a', mediator);
    shared_ptr<Colleague> b = make_shared<ColleagueB>('b', mediator);

    mediator->addColleague(a->getId(), weak_ptr<Colleague>(a));
    mediator->addColleague(b->getId(), weak_ptr<Colleague>(b));

    a->send("a, send a msg.", b->getId());
    b->send("B, send a msg.", a->getId());
}